package concept.chapter7.writtinggenericmethods;

class A{}
class B extends A{}

public class Monitor<E, T extends E>
{
	public T getSame(E e)
	{
		return (T)e;
	}
	
	public static void main(String...strings)
	{
		Monitor<A, B> m = new Monitor<A, B>();
		B b = m.getSame(new B());
		A a = m.getSame(new B());
		
		Monitor<Number, Integer> monitor = new Monitor<Number, Integer>();
		Integer i = monitor.getSame(new Integer(0));
	}
}
